ChangeTrust
The ChangeTrust API allows users to change or establish a trustline for a specific asset in their Stellar account. A trustline represents an agreement to accept a particular asset from a specific issuer.
Method: POST
{{URL}}/jsonrpc
Headers
Name | Value |
---|---|
Content-Type | application/json |
Example
Response Parameters
Parameter | Description |
---|---|
SourceAccount | Object |
PublicKey Mandatory | String The public key of the account for which the trustline is being changed. Ex: "GCPLZXWATKYY3OXXHDOU3TSIUNZA5ZVBMM6P6ONGZQJHICXSFGFWNBPW" |
PrivateKey Mandatory | String The private key associated with the source account for authentication. Ex: "" |
Asset | Object |
Code Mandatory | String The code representing the asset for which the trustline is being established or modified. Ex: "XDUS" |
IssuserKey Mandatory | String The public key of the account that issued the asset. Ex: "GAHQYF2BNR5PGXPMWHOPXQA2Y3T2HVBBBF7ON7D2427T7FPZRMIRE6XD" |
sponser | Object |
PublicKey Mandatory | String The public key of the account acting as the sponsor for the transaction fee. Ex: "GAUMO2B3RA6HRNDEVZUZAV5ZP2YE5V37UZTIFMKKRAH2IK5XDTZBJCZ3" |
PrivateKey Mandatory | String The private key associated with the sponsor account for authentication. Ex: "" |
IssuerAccount | Object |
PublicKey Mandatory | String The public key of the account that issued the asset. Ex: "GAUMO2B3RA6HRNDEVZUZAV5ZP2YE5V37UZTIFMKKRAH2IK5XDTZBJCZ3" |
PrivateKey Mandatory | String The private key associated with the issuer account for authentication. Ex: "" |
TrustLimit Mandatory | Number The maximum limit or amount of the asset that the account is willing to accept in the trustline. Ex: 1234 |
Body
{
"SourceAccount": {
"PublicKey": "GCPLZXWATKYY3OXXHDOU3TSIUNZA5ZVBMM6P6ONGZQJHICXSFGFWNBPW",
"PrivateKey": ""
},
"Asset": {
"Code": "XDUS",
"IssuserKey": "GAHQYF2BNR5PGXPMWHOPXQA2Y3T2HVBBBF7ON7D2427T7FPZRMIRE6XD"
},
"sponser": {
"publicKey": "GAUMO2B3RA6HRNDEVZUZAV5ZP2YE5V37UZTIFMKKRAH2IK5XDTZBJCZ3",
"PrivateKey": ""
},
"IssuerAccount": {
"publicKey": "GAUMO2B3RA6HRNDEVZUZAV5ZP2YE5V37UZTIFMKKRAH2IK5XDTZBJCZ3",
"PrivateKey": ""
},
"TrustLimit": 1234
}
Response: 200
Response Parameters
Parameter | Description |
---|---|
hash | String A unique identifier representing the transaction hash of the ChangeTrust operation. Ex: "fbef2e61b8961114a285a8d1ba9c20076f13f636db4fc452dae64bf763390724" |
{
"hash": "fbef2e61b8961114a285a8d1ba9c20076f13f636db4fc452dae64bf763390724"
}